<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
	<ui:composition template="../../templates/commonLayoutUsers.xhtml">
	<ui:define name="title">#{msg.titleUser}</ui:define>
		<ui:define name="content">
			<h:form id="changePasswordForm">     
		     	<h2>#{msg.changePassword}</h2>
		     	<h:panelGrid columns="3">
		     	
		    		<h:outputLabel for="oldPassword" value="#{msg.old_password}"/>
				    <p:password id="oldPassword" 
				    	value="#{changePasswordMB.oldPassword}" 
				    	required="true" 
				    	maxlength="256"
				    	requiredMessage="#{msg.old_password_requeried}" 
				    	title="#{component.valid ? '' : manageBean.getErrorMessage(component.clientId)}"/>
				    <p:message id="oldPasswordMsg" for="oldPassword" display="icon"/> 
		     	
		     	
		     		<h:outputLabel for="password" value="#{msg.new_password}"/>
				    <p:password id="newPassword" 
				    	value="#{changePasswordMB.newPassword}" 
				    	required="true" 
				    	maxlength="256"
				    	requiredMessage="#{msg.new_password_requeried}" 
				    	match="confirmNewPassword" 
				    	title="#{component.valid ? '' : manageBean.getErrorMessage(component.clientId)}" 
				    	validatorMessage="#{msg.lengthPassword}">
				    	<f:validateLength minimum="6" /> 
				    </p:password>
				    <p:message id="newPasswordMsg" for="newPassword" display="icon"/> 
				    
				    <h:outputLabel for="confirmNewPassword" value="#{msg.new_passwordConfirmation}"/>
				    <p:password id="confirmNewPassword" 
				    	value="#{changePasswordMB.newPasswordConfirmation}" 
				    	required="true" 
				    	maxlength="256"
				    	requiredMessage="#{msg.new_passwordConfirmation_requeried}" 
				    	title="#{component.valid ? '' : manageBean.getErrorMessage(component.clientId)}"/>
				    <p:message id="confirmNewPasswordMsg" for="confirmNewPassword" display="icon"/> 
		     	
		     	</h:panelGrid>
		     	<h:panelGrid columns="1" style="margin-top:10px; text-align:center">
		     		<p:commandButton value="#{msg.saveButton}" action="#{changePasswordMB.changePassword}" ajax="false" styleClass="button-action green"/>
		     	</h:panelGrid>
		    </h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>